package core.compagnie;

import java.util.Hashtable;

public class MetaCompagnie {
	
	private String nom;
	private Hashtable <String, CompAerienne> compagnies;
	/**
	 * @param nom
	 */
	public MetaCompagnie(String nom) {
		super();
		this.nom = nom;
		compagnies = new Hashtable<String, CompAerienne>();
	}
	
	/**
	 * @param nom
	 * @param compagnies
	 */
	public MetaCompagnie(String nom, Hashtable<String, CompAerienne> compagnies) {
		super();
		this.nom = nom;
		this.compagnies = compagnies;
	}
	
	public void addCompagnie (CompAerienne c) {
		compagnies.put(c.getNom(), c);
	}
	
	public void removeCompagnie(CompAerienne c) {
		compagnies.remove(c);
	}

	/**
	 * @return the nom
	 */
	public String getNom() {
		return nom;
	}

	/**
	 * @return the compagnies
	 */
	public Hashtable<String, CompAerienne> getCompagnies() {
		return compagnies;
	}
	
	public boolean compIsInMetaComp (CompAerienne c) {
		return getCompagnies().contains(c);
	}
	

}
